For Loops Exercise and Solution 6

Exercise 6: Write a program that read three persons’ heights and display the best sport fits to this person according to the following table.

Tall in CMBest sport
< 159Tennis
between 160 & 175Foorball aka Soccer
> 175Basketball
See below the code and output:
	    for i in range (1,4):
            height = float(input("Enter your height in CM: "))
            if (height<165):
                print ("The best sport is Tennis")
            elif (height >= 166 and height <= 175):
                print ("The best sport is Football")
            elif (height >175):
                print ("The best sport is Basketball")
	


For more details, please contact me here.
Date of last modification: 2021